// 封装医院的接口
import request from '@/utils/request';

// 获取医院数据
export const getHospitalListAPI = ({page,  limit ,hostype, districtCode}) => {
    return request.get(`/hosp/hospital/${page}/${limit}?hostype=${hostype}&districtCoded=${districtCode}`);
}

// 获取医院等级或地址
export const getHospitalLevelListAPI = (dictCode) => {
    return request.get(`/cmn/dict/findByDictCode/${dictCode}`);
}

// 根据关键字搜索医院
export const getHospitalByKeywordAPI = (hosname) => {
    return request.get(`/hosp/hospital/findByHosname/${hosname}`)
}

// 获取医院详情
export const getHospitalDetailAPI = (hoscode) => {
    return request.get(`/hosp/hospital/${hoscode}`);
}

// 获取医院科室信息
export const getDepartmentListAPI = (hoscode) => {
    return request.get(`/hosp/hospital/department/${hoscode} `)
} 

// 获取医院科室挂号详情
export const getScheduleListAPI = ({hoscode, depcode,limit,page}) => {
    return request.get(`/hosp/hospital/auth/getBookingScheduleRule/${page}/${limit}/${hoscode}/${depcode}`)
}

// 获取排班数据
export const getScheduleRuleAPI = ({hoscode, depcode, workDate}) => {
    return request.get(`/hosp/hospital/auth/findScheduleList/${hoscode}/${depcode}/${workDate}`)
}

// 获取医生数据
export const getDoctorInfoAPI = (scheduleId) => {
    return request.get(`/hosp/hospital/getSchedule/${scheduleId}`)
}

// 确认挂号提交
export const submitRegistrationAPI = (hoscode, scheduleId,patientId) => {
    return request.post(`/order/orderInfo/auth/submitOrder/${hoscode}/${scheduleId}/${patientId}`)
}

